#include "friendaddfriendrequest.h"
#include "common/defines.h"

// Qt includes
#include <QDebug>


namespace Friend{

AddFriendRequest::AddFriendRequest(const QString &friendName,
                                   const QString &message,
                                   const QString &sessionKey):
    m_friendAccount(friendName),
    m_message(message),
    m_sessionKey(sessionKey),
    m_response(new AddFriendResponse(this))
{
}

AddFriendRequest::~AddFriendRequest()
{
    delete m_response;
    m_response = 0;
}

Network::JSONResponse &AddFriendRequest::jsonResponse()
{
    return *m_response;
}

const Network::JSONResponse &AddFriendRequest::jsonResponse() const
{
    return *m_response;
}

QUrl AddFriendRequest::url() const
{
    QString url = QString(REST_FRIEND_PATH) + \
            QString(PARAM_SEND_FRIEND_REQUEST_BY_NAME)
            .arg(m_sessionKey).arg(m_friendAccount).arg(m_message);
    qDebug() << url ;
    return QUrl(url);
}

} // namespace Friend
